package pers.cz.testNg;

import java.util.HashMap;
import java.util.Map;

/**
 * 策略工厂
 * @program: PostGirl-panent
 * @description: ParamMethodFactory
 * @author: Cheng Zhi
 * @create: 2021-11-25 15:15
 **/
public class ParamMethodFactory {

    private Map<String, IMethodJudge> map;

    public ParamMethodFactory() {
        map = new HashMap<>();
        map.put("code", new CodeMethodJudgeImpl());
        map.put("sql", new SqlMethodJudgeImpl());
        map.put("single", new SingleMethodJudgeImpl());
        map.put("regular", new RegularExprMethodJudgeImpl());
    }

    public IMethodJudge getMethodImpl(String name) {
        return map.get(name);
    }

}
